<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>正则表达式</title>
</head>
<body>
            <script>
                var reg = /^123/;     //使用^ 开始
                var s = '123457978133454';
                var r = reg.test(s);
                console.log(r)

            </script>
</body>
</html>